﻿using DryIoc;
//using ModuleA;
using Prism.DryIoc;
using Prism.Ioc;
using Prism.Modularity;
using System.Configuration;
using System.Data;
using System.Reflection.Metadata;
using System.Windows;
using wpfForPrism.Views;

namespace wpfForPrism
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : PrismApplication
    {
        /// <summary>
        /// 设置启动页
        /// </summary>
        /// <returns></returns>
        protected override Window CreateShell()
        {
            return Container.Resolve<MainWindow>();
        }

        /// <summary>
        /// 注入服务
        /// </summary>
        /// <param name="containerRegistry"></param>
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation<UCA>("A");
            containerRegistry.RegisterForNavigation<UCB>("B");
            containerRegistry.RegisterForNavigation<UCC>("C");
        }

        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        {
            moduleCatalog.AddModule<ModuleA.ModuleAProfile>();
            moduleCatalog.AddModule<ModuleB.ModuleBProfile>();
            base.ConfigureModuleCatalog(moduleCatalog);
        }

        //protected override IModuleCatalog CreateModuleCatalog()
        //{
        //    //return base.CreateModuleCatalog();
        //    return new DirectoryModuleCatalog() { ModulePath=@".\Modules"};
        //}
    }

}
